/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author has
 */
@Entity
@Table(name = "pilihstatus", catalog = "onsale", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pilihstatus.findAll", query = "SELECT p FROM Pilihstatus p"),
    @NamedQuery(name = "Pilihstatus.findByIdPilihStatus", query = "SELECT p FROM Pilihstatus p WHERE p.idPilihStatus = :idPilihStatus"),
    @NamedQuery(name = "Pilihstatus.findByStatus", query = "SELECT p FROM Pilihstatus p WHERE p.status = :status")})
public class Pilihstatus implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idPilihStatus", nullable = false)
    private Integer idPilihStatus;
    @Column(name = "status", length = 5)
    private String status;
    @JoinColumn(name = "idUser", referencedColumnName = "idUser")
    @ManyToOne(fetch = FetchType.LAZY)
    private User idUser;

    public Pilihstatus() {
    }

    public Pilihstatus(Integer idPilihStatus) {
        this.idPilihStatus = idPilihStatus;
    }

    public Integer getIdPilihStatus() {
        return idPilihStatus;
    }

    public void setIdPilihStatus(Integer idPilihStatus) {
        this.idPilihStatus = idPilihStatus;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public User getIdUser() {
        return idUser;
    }

    public void setIdUser(User idUser) {
        this.idUser = idUser;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPilihStatus != null ? idPilihStatus.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pilihstatus)) {
            return false;
        }
        Pilihstatus other = (Pilihstatus) object;
        if ((this.idPilihStatus == null && other.idPilihStatus != null) || (this.idPilihStatus != null && !this.idPilihStatus.equals(other.idPilihStatus))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Pilihstatus[ idPilihStatus=" + idPilihStatus + " ]";
    }
    
}
